/**
 * 专辑封面组件
 */

import React, { memo } from 'react';

import { formatImageSize } from "@/utils/format-utils";

import { AlbumCoverWrapper } from "./style";


const AlbumCover = memo((props) => {
  const { item, size = 130, width = 153, bgp = "-845px" } = props;

  return (
    <AlbumCoverWrapper size={size} width={width} bgp={bgp}>
      <div className="album-image">
        <img src={formatImageSize(item.picUrl, size)} alt={item.name} />
        <a href="/todo" className="cover image_cover">{item.name}</a>
      </div>

      <div className="album-info">
        <div className="name text-nowrap">{item.name}</div>
        <div className="artist text-nowrap">{item.artist.name}</div>
      </div>
    </AlbumCoverWrapper>
  )
})

export default AlbumCover